<?php
/**
 * Created by PhpStorm.
 * User: xiaom
 * Date: 2016/9/25 0025
 * Time: 12:21
 */

namespace Net\Controller;

use Common\Controller\AdminbaseController;

class TelecomClientController extends AdminbaseController {

    public function _initialize()
    {
        vendor('Requests.library.Requests');
        \Requests::register_autoloader();
    }

    public function index(){
        $url='http://116.252.82.214:9009/MOBILE/rest/mobileService/directserv/SERVICE_CODE_620';
        $headers = array('Host'=>'116.252.82.214:9009');
        $data = array(
            'params' => '%7B%22passData%22%3A%7B%22paramXml%22%3A%22%3C%3Fxml+version%3D%5C%221.0%5C%22+encoding%3D%5C%22GBK%5C%22+%3F%3E%3CSERVICE%3E%3CIDA_COMMON%3E%3CCALL_METHOD%3EZAD_ORDER_LIST_ALL%3C%5C%2FCALL_METHOD%3E%3CINPUT_XMLDATA%3E%3CCALL_METHOD%3EZAD_ORDER_LIST_ALL%3C%5C%2FCALL_METHOD%3E%3CSTAFFID%3E113218%3C%5C%2FSTAFFID%3E%3C%5C%2FINPUT_XMLDATA%3E%3C%5C%2FIDA_COMMON%3E%3C%5C%2FSERVICE%3E%22%7D%7D',
        );
        $response = \Requests::post($url, $headers, $data);
        $xml=simplexml_load_string($response->body,'SimpleXMLElement',LIBXML_NOCDATA,'',true);
        $result=json_decode(json_encode($xml),TRUE);
//        dump($result['RETURNLIST']['ROWVALUE']['13']);
        $this->assign('TelecomData',$result['RETURNLIST']['ROWVALUE']);
        $this->display();
    }
}